﻿@model QqhrCitizen.Models.ViewModel.vUserPwdEdit
@using QqhrCitizen.Models.ViewModel
@{
    ViewBag.Title = "修改用户密码信息 - 齐齐哈尔市民学习网";
    vUserPwdEdit user = @ViewBag.user as vUserPwdEdit;
}
<div id="d_menu" class="d-menu menu-use">
    <div id="d_menu_c" class="d-menu-c">
        <!-- region start: menu -->
        <div id="d_headmenu" class="d-headmenu">
            <div class="body">
                <a id="headmenu_useraccount" class="item_selected" href="/User/Show/@user.ID">个人信息</a>
                <a id="headmenu_history" class="item" href="/User/HistoryCourse/@user.ID">学习档案</a>
            </div>
        </div><!-- region end: menu -->
    </div>
</div>
<div id="d_bottom" class="d-bottom" style="visibility: hidden;">
    <div class="d-bottom-c">
        <div id="d_scrolltop" class="d-scrolltop">
            <span class="t" onclick="$('html,body').animate({scrollTop: '0px'}, 800);">顶部</span>
        </div>
    </div>
</div>
<script>
    function UserPwdEditCheck() {
        if (!CheckPassword()) return false;
    }
    function CheckPassword() {
        if ($("#PasswordNew").val() != "") {
            if ($("#PasswordNew").val().length < 4) {
                CastMsg("至少输入4位密码");
                return false;
            }
        }
        if ($('#PasswordNew').val() != $('#NewPassword').val()) {
            CastMsg("两次输入密码不一致");
            $("#ConfirmInfo").css("color:red");
            return false;
        }

        return true;
    }


</script>
<div class="d-row" style="padding:0 0 40px 0">
    <div class="d-row-c">
        <div class="d-col-2-8">
            <div class="contentarea">
                @using (Html.BeginForm("PwdEdit", "User", FormMethod.Post, new
                {
                    onsubmit = "return UserPwdEditCheck();"
                }))
                {
                    @Html.AntiForgerySID()
                    @Html.HiddenFor(model => model.ID, new { @value = user.ID })
                <!-- region start: 修改密码 -->
                    <div id="d_personalinfo" class="d-personalinfo" data-km-url="">
                        <div class="head">
                            修改密码
                        </div>
                        <div class="info"></div>
                        <table class="tbl">
                            <tr>
                                <td style="width:100px;">
                                    <div>
                                        旧密码
                                    </div>
                                </td>
                                <td>
                                    <div>
                                        @Html.PasswordFor(model => model.Password, new { @class = "int-hs", @style = "width:250px;" })
                                        <span class="text"></span>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        新密码
                                    </div>
                                </td>
                                <td>
                                    <div>
                                        @Html.PasswordFor(model => model.PasswordNew, new { @class = "int-hs", @style = "width:250px;" })
                                        <span class="text"></span>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        确认密码
                                    </div>
                                </td>
                                <td>
                                    <div>
                                        @Html.Password("NewPassword", "", new { @class = "int-hs", @style = "width:250px;" })
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        &nbsp;
                                    </div>
                                </td>
                                <td>
                                    <div>
                                        <input type="submit" id="int_submit" value="保存修改" class="btn btn-big btn-orange" style="width:120px;" />
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <div class="info"></div>
                    </div><!-- region end: 修改密码 -->
                }
            </div>
        </div>
        <div class="d-col-2-4">
            <div class="contentarea">
                <!-- region start: 个人设置 -->
                <div id="d_settings" class="d-settings">
                    <div class="head">
                        &nbsp;
                    </div><div class="body">
                        <div class="item">
                            <a href="/User/PwdEdit/@user.ID">修改密码</a>
                        </div>
                        <div class="item">
                            <a href="/User/Edit/@user.ID">修改个人信息</a>
                        </div>
                    </div>
                </div>
                <!-- region end: 个人设置 -->
                <input type="hidden" id="redirect" name="redirect">
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>